<script setup>
import { ref, watchEffect } from 'vue';
import { useRouter, RouterView } from 'vue-router';

const router = useRouter();
const authState = ref(null);

// 监听localStorage变化
watchEffect(() => {
  const authData = localStorage.getItem('user');
  authState.value = authData ? JSON.parse(authData) : null;
});
</script>
<template>
  <RouterView />
</template>
